//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2022 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

import Foundation
import SotoCore

extension IoTRoboRunner {
    // MARK: Enums

    public enum DestinationState: String, CustomStringConvertible, Codable, _SotoSendable {
        case decommissioned = "DECOMMISSIONED"
        case disabled = "DISABLED"
        case enabled = "ENABLED"
        public var description: String { return self.rawValue }
    }

    // MARK: Shapes

    public struct CartesianCoordinates: AWSEncodableShape & AWSDecodableShape {
        /// X coordinate.
        public let x: Double
        /// Y coordinate.
        public let y: Double
        /// Z coordinate.
        public let z: Double?

        public init(x: Double, y: Double, z: Double? = nil) {
            self.x = x
            self.y = y
            self.z = z
        }

        private enum CodingKeys: String, CodingKey {
            case x
            case y
            case z
        }
    }

    public struct CreateDestinationRequest: AWSEncodableShape {
        public let additionalFixedProperties: String?
        public let clientToken: String?
        public let name: String
        public let site: String
        /// The state of the destination. Default used if not specified.
        public let state: DestinationState?

        public init(additionalFixedProperties: String? = nil, clientToken: String? = CreateDestinationRequest.idempotencyToken(), name: String, site: String, state: DestinationState? = nil) {
            self.additionalFixedProperties = additionalFixedProperties
            self.clientToken = clientToken
            self.name = name
            self.site = site
            self.state = state
        }

        public func validate(name: String) throws {
            try self.validate(self.additionalFixedProperties, name: "additionalFixedProperties", parent: name, max: 131_072)
            try self.validate(self.additionalFixedProperties, name: "additionalFixedProperties", parent: name, min: 1)
            try self.validate(self.clientToken, name: "clientToken", parent: name, max: 64)
            try self.validate(self.clientToken, name: "clientToken", parent: name, min: 1)
            try self.validate(self.clientToken, name: "clientToken", parent: name, pattern: "^[!-~]*$")
            try self.validate(self.name, name: "name", parent: name, max: 255)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.site, name: "site", parent: name, max: 1011)
            try self.validate(self.site, name: "site", parent: name, min: 1)
            try self.validate(self.site, name: "site", parent: name, pattern: "^arn:aws:iotroborunner:[\\w-]+:\\w+:site/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")
        }

        private enum CodingKeys: String, CodingKey {
            case additionalFixedProperties
            case clientToken
            case name
            case site
            case state
        }
    }

    public struct CreateDestinationResponse: AWSDecodableShape {
        public let arn: String
        public let createdAt: Date
        public let id: String
        public let state: DestinationState
        public let updatedAt: Date

        public init(arn: String, createdAt: Date, id: String, state: DestinationState, updatedAt: Date) {
            self.arn = arn
            self.createdAt = createdAt
            self.id = id
            self.state = state
            self.updatedAt = updatedAt
        }

        private enum CodingKeys: String, CodingKey {
            case arn
            case createdAt
            case id
            case state
            case updatedAt
        }
    }

    public struct CreateSiteRequest: AWSEncodableShape {
        public let clientToken: String?
        public let countryCode: String
        public let description: String?
        public let name: String

        public init(clientToken: String? = CreateSiteRequest.idempotencyToken(), countryCode: String, description: String? = nil, name: String) {
            self.clientToken = clientToken
            self.countryCode = countryCode
            self.description = description
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.clientToken, name: "clientToken", parent: name, max: 64)
            try self.validate(self.clientToken, name: "clientToken", parent: name, min: 1)
            try self.validate(self.clientToken, name: "clientToken", parent: name, pattern: "^[!-~]*$")
            try self.validate(self.countryCode, name: "countryCode", parent: name, max: 2)
            try self.validate(self.countryCode, name: "countryCode", parent: name, min: 2)
            try self.validate(self.countryCode, name: "countryCode", parent: name, pattern: "^[a-zA-Z]{2}$")
            try self.validate(self.description, name: "description", parent: name, max: 140)
            try self.validate(self.name, name: "name", parent: name, max: 255)
            try self.validate(self.name, name: "name", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case clientToken
            case countryCode
            case description
            case name
        }
    }

    public struct CreateSiteResponse: AWSDecodableShape {
        public let arn: String
        public let createdAt: Date
        public let id: String
        public let updatedAt: Date

        public init(arn: String, createdAt: Date, id: String, updatedAt: Date) {
            self.arn = arn
            self.createdAt = createdAt
            self.id = id
            self.updatedAt = updatedAt
        }

        private enum CodingKeys: String, CodingKey {
            case arn
            case createdAt
            case id
            case updatedAt
        }
    }

    public struct CreateWorkerFleetRequest: AWSEncodableShape {
        public let additionalFixedProperties: String?
        public let clientToken: String?
        public let name: String
        public let site: String

        public init(additionalFixedProperties: String? = nil, clientToken: String? = CreateWorkerFleetRequest.idempotencyToken(), name: String, site: String) {
            self.additionalFixedProperties = additionalFixedProperties
            self.clientToken = clientToken
            self.name = name
            self.site = site
        }

        public func validate(name: String) throws {
            try self.validate(self.additionalFixedProperties, name: "additionalFixedProperties", parent: name, max: 131_072)
            try self.validate(self.additionalFixedProperties, name: "additionalFixedProperties", parent: name, min: 1)
            try self.validate(self.clientToken, name: "clientToken", parent: name, max: 64)
            try self.validate(self.clientToken, name: "clientToken", parent: name, min: 1)
            try self.validate(self.clientToken, name: "clientToken", parent: name, pattern: "^[!-~]*$")
            try self.validate(self.name, name: "name", parent: name, max: 255)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.site, name: "site", parent: name, max: 1011)
            try self.validate(self.site, name: "site", parent: name, min: 1)
            try self.validate(self.site, name: "site", parent: name, pattern: "^arn:aws:iotroborunner:[\\w-]+:\\w+:site/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")
        }

        private enum CodingKeys: String, CodingKey {
            case additionalFixedProperties
            case clientToken
            case name
            case site
        }
    }

    public struct CreateWorkerFleetResponse: AWSDecodableShape {
        public let arn: String
        public let createdAt: Date
        public let id: String
        public let updatedAt: Date

        public init(arn: String, createdAt: Date, id: String, updatedAt: Date) {
            self.arn = arn
            self.createdAt = createdAt
            self.id = id
            self.updatedAt = updatedAt
        }

        private enum CodingKeys: String, CodingKey {
            case arn
            case createdAt
            case id
            case updatedAt
        }
    }

    public struct CreateWorkerRequest: AWSEncodableShape {
        public let additionalFixedProperties: String?
        public let additionalTransientProperties: String?
        public let clientToken: String?
        public let fleet: String
        public let name: String
        public let orientation: Orientation?
        public let position: PositionCoordinates?
        public let vendorProperties: VendorProperties?

        public init(additionalFixedProperties: String? = nil, additionalTransientProperties: String? = nil, clientToken: String? = CreateWorkerRequest.idempotencyToken(), fleet: String, name: String, orientation: Orientation? = nil, position: PositionCoordinates? = nil, vendorProperties: VendorProperties? = nil) {
            self.additionalFixedProperties = additionalFixedProperties
            self.additionalTransientProperties = additionalTransientProperties
            self.clientToken = clientToken
            self.fleet = fleet
            self.name = name
            self.orientation = orientation
            self.position = position
            self.vendorProperties = vendorProperties
        }

        public func validate(name: String) throws {
            try self.validate(self.additionalFixedProperties, name: "additionalFixedProperties", parent: name, max: 131_072)
            try self.validate(self.additionalFixedProperties, name: "additionalFixedProperties", parent: name, min: 1)
            try self.validate(self.additionalTransientProperties, name: "additionalTransientProperties", parent: name, max: 131_072)
            try self.validate(self.additionalTransientProperties, name: "additionalTransientProperties", parent: name, min: 1)
            try self.validate(self.clientToken, name: "clientToken", parent: name, max: 64)
            try self.validate(self.clientToken, name: "clientToken", parent: name, min: 1)
            try self.validate(self.clientToken, name: "clientToken", parent: name, pattern: "^[!-~]*$")
            try self.validate(self.fleet, name: "fleet", parent: name, max: 1011)
            try self.validate(self.fleet, name: "fleet", parent: name, min: 1)
            try self.validate(self.fleet, name: "fleet", parent: name, pattern: "^arn:aws:iotroborunner:[\\w-]+:\\w+:site/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/worker-fleet/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")
            try self.validate(self.name, name: "name", parent: name, max: 255)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.vendorProperties?.validate(name: "\(name).vendorProperties")
        }

        private enum CodingKeys: String, CodingKey {
            case additionalFixedProperties
            case additionalTransientProperties
            case clientToken
            case fleet
            case name
            case orientation
            case position
            case vendorProperties
        }
    }

    public struct CreateWorkerResponse: AWSDecodableShape {
        public let arn: String
        public let createdAt: Date
        public let id: String
        public let site: String
        public let updatedAt: Date

        public init(arn: String, createdAt: Date, id: String, site: String, updatedAt: Date) {
            self.arn = arn
            self.createdAt = createdAt
            self.id = id
            self.site = site
            self.updatedAt = updatedAt
        }

        private enum CodingKeys: String, CodingKey {
            case arn
            case createdAt
            case id
            case site
            case updatedAt
        }
    }

    public struct DeleteDestinationRequest: AWSEncodableShape {
        public let id: String

        public init(id: String) {
            self.id = id
        }

        public func validate(name: String) throws {
            try self.validate(self.id, name: "id", parent: name, max: 1011)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "^arn:aws:iotroborunner:[\\w-]+:\\w+:destination/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$|^arn:aws:iotroborunner:[\\w-]+:\\w+:site/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/destination/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")
        }

        private enum CodingKeys: String, CodingKey {
            case id
        }
    }

    public struct DeleteDestinationResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteSiteRequest: AWSEncodableShape {
        public let id: String

        public init(id: String) {
            self.id = id
        }

        public func validate(name: String) throws {
            try self.validate(self.id, name: "id", parent: name, max: 1011)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "^arn:aws:iotroborunner:[\\w-]+:\\w+:site/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")
        }

        private enum CodingKeys: String, CodingKey {
            case id
        }
    }

    public struct DeleteSiteResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteWorkerFleetRequest: AWSEncodableShape {
        public let id: String

        public init(id: String) {
            self.id = id
        }

        public func validate(name: String) throws {
            try self.validate(self.id, name: "id", parent: name, max: 1011)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "^arn:aws:iotroborunner:[\\w-]+:\\w+:site/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/worker-fleet/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")
        }

        private enum CodingKeys: String, CodingKey {
            case id
        }
    }

    public struct DeleteWorkerFleetResponse: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteWorkerRequest: AWSEncodableShape {
        public let id: String

        public init(id: String) {
            self.id = id
        }

        public func validate(name: String) throws {
            try self.validate(self.id, name: "id", parent: name, max: 1011)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "^arn:aws:iotroborunner:[\\w-]+:\\w+:site/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/worker-fleet/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/worker/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")
        }

        private enum CodingKeys: String, CodingKey {
            case id
        }
    }

    public struct DeleteWorkerResponse: AWSDecodableShape {
        public init() {}
    }

    public struct Destination: AWSDecodableShape {
        public let additionalFixedProperties: String?
        public let arn: String
        public let createdAt: Date
        public let id: String
        public let name: String
        public let site: String
        public let state: DestinationState
        public let updatedAt: Date

        public init(additionalFixedProperties: String? = nil, arn: String, createdAt: Date, id: String, name: String, site: String, state: DestinationState, updatedAt: Date) {
            self.additionalFixedProperties = additionalFixedProperties
            self.arn = arn
            self.createdAt = createdAt
            self.id = id
            self.name = name
            self.site = site
            self.state = state
            self.updatedAt = updatedAt
        }

        private enum CodingKeys: String, CodingKey {
            case additionalFixedProperties
            case arn
            case createdAt
            case id
            case name
            case site
            case state
            case updatedAt
        }
    }

    public struct GetDestinationRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "id", location: .querystring("id"))
        ]

        public let id: String

        public init(id: String) {
            self.id = id
        }

        public func validate(name: String) throws {
            try self.validate(self.id, name: "id", parent: name, max: 1011)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "^arn:aws:iotroborunner:[\\w-]+:\\w+:destination/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$|^arn:aws:iotroborunner:[\\w-]+:\\w+:site/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/destination/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetDestinationResponse: AWSDecodableShape {
        public let additionalFixedProperties: String?
        public let arn: String
        public let createdAt: Date
        public let id: String
        public let name: String
        public let site: String
        public let state: DestinationState
        public let updatedAt: Date

        public init(additionalFixedProperties: String? = nil, arn: String, createdAt: Date, id: String, name: String, site: String, state: DestinationState, updatedAt: Date) {
            self.additionalFixedProperties = additionalFixedProperties
            self.arn = arn
            self.createdAt = createdAt
            self.id = id
            self.name = name
            self.site = site
            self.state = state
            self.updatedAt = updatedAt
        }

        private enum CodingKeys: String, CodingKey {
            case additionalFixedProperties
            case arn
            case createdAt
            case id
            case name
            case site
            case state
            case updatedAt
        }
    }

    public struct GetSiteRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "id", location: .querystring("id"))
        ]

        public let id: String

        public init(id: String) {
            self.id = id
        }

        public func validate(name: String) throws {
            try self.validate(self.id, name: "id", parent: name, max: 1011)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "^arn:aws:iotroborunner:[\\w-]+:\\w+:site/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetSiteResponse: AWSDecodableShape {
        public let arn: String
        public let countryCode: String
        public let createdAt: Date
        public let description: String?
        public let id: String
        public let name: String
        public let updatedAt: Date

        public init(arn: String, countryCode: String, createdAt: Date, description: String? = nil, id: String, name: String, updatedAt: Date) {
            self.arn = arn
            self.countryCode = countryCode
            self.createdAt = createdAt
            self.description = description
            self.id = id
            self.name = name
            self.updatedAt = updatedAt
        }

        private enum CodingKeys: String, CodingKey {
            case arn
            case countryCode
            case createdAt
            case description
            case id
            case name
            case updatedAt
        }
    }

    public struct GetWorkerFleetRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "id", location: .querystring("id"))
        ]

        public let id: String

        public init(id: String) {
            self.id = id
        }

        public func validate(name: String) throws {
            try self.validate(self.id, name: "id", parent: name, max: 1011)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "^arn:aws:iotroborunner:[\\w-]+:\\w+:site/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/worker-fleet/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetWorkerFleetResponse: AWSDecodableShape {
        public let additionalFixedProperties: String?
        public let arn: String
        public let createdAt: Date
        public let id: String
        public let name: String
        public let site: String
        public let updatedAt: Date

        public init(additionalFixedProperties: String? = nil, arn: String, createdAt: Date, id: String, name: String, site: String, updatedAt: Date) {
            self.additionalFixedProperties = additionalFixedProperties
            self.arn = arn
            self.createdAt = createdAt
            self.id = id
            self.name = name
            self.site = site
            self.updatedAt = updatedAt
        }

        private enum CodingKeys: String, CodingKey {
            case additionalFixedProperties
            case arn
            case createdAt
            case id
            case name
            case site
            case updatedAt
        }
    }

    public struct GetWorkerRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "id", location: .querystring("id"))
        ]

        public let id: String

        public init(id: String) {
            self.id = id
        }

        public func validate(name: String) throws {
            try self.validate(self.id, name: "id", parent: name, max: 1011)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "^arn:aws:iotroborunner:[\\w-]+:\\w+:site/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/worker-fleet/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/worker/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetWorkerResponse: AWSDecodableShape {
        public let additionalFixedProperties: String?
        public let additionalTransientProperties: String?
        public let arn: String
        public let createdAt: Date
        public let fleet: String
        public let id: String
        public let name: String
        public let orientation: Orientation?
        public let position: PositionCoordinates?
        public let site: String
        public let updatedAt: Date
        public let vendorProperties: VendorProperties?

        public init(additionalFixedProperties: String? = nil, additionalTransientProperties: String? = nil, arn: String, createdAt: Date, fleet: String, id: String, name: String, orientation: Orientation? = nil, position: PositionCoordinates? = nil, site: String, updatedAt: Date, vendorProperties: VendorProperties? = nil) {
            self.additionalFixedProperties = additionalFixedProperties
            self.additionalTransientProperties = additionalTransientProperties
            self.arn = arn
            self.createdAt = createdAt
            self.fleet = fleet
            self.id = id
            self.name = name
            self.orientation = orientation
            self.position = position
            self.site = site
            self.updatedAt = updatedAt
            self.vendorProperties = vendorProperties
        }

        private enum CodingKeys: String, CodingKey {
            case additionalFixedProperties
            case additionalTransientProperties
            case arn
            case createdAt
            case fleet
            case id
            case name
            case orientation
            case position
            case site
            case updatedAt
            case vendorProperties
        }
    }

    public struct ListDestinationsRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "maxResults", location: .querystring("maxResults")),
            AWSMemberEncoding(label: "nextToken", location: .querystring("nextToken")),
            AWSMemberEncoding(label: "site", location: .querystring("site")),
            AWSMemberEncoding(label: "state", location: .querystring("state"))
        ]

        public let maxResults: Int?
        public let nextToken: String?
        public let site: String
        public let state: DestinationState?

        public init(maxResults: Int? = nil, nextToken: String? = nil, site: String, state: DestinationState? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.site = site
            self.state = state
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 1000)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "[a-zA-Z0-9_.-/+=]*")
            try self.validate(self.site, name: "site", parent: name, max: 1011)
            try self.validate(self.site, name: "site", parent: name, min: 1)
            try self.validate(self.site, name: "site", parent: name, pattern: "^arn:aws:iotroborunner:[\\w-]+:\\w+:site/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListDestinationsResponse: AWSDecodableShape {
        public let destinations: [Destination]?
        public let nextToken: String?

        public init(destinations: [Destination]? = nil, nextToken: String? = nil) {
            self.destinations = destinations
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case destinations
            case nextToken
        }
    }

    public struct ListSitesRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "maxResults", location: .querystring("maxResults")),
            AWSMemberEncoding(label: "nextToken", location: .querystring("nextToken"))
        ]

        public let maxResults: Int?
        public let nextToken: String?

        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 25)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "[a-zA-Z0-9_.-/+=]*")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListSitesResponse: AWSDecodableShape {
        public let nextToken: String?
        public let sites: [Site]?

        public init(nextToken: String? = nil, sites: [Site]? = nil) {
            self.nextToken = nextToken
            self.sites = sites
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken
            case sites
        }
    }

    public struct ListWorkerFleetsRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "maxResults", location: .querystring("maxResults")),
            AWSMemberEncoding(label: "nextToken", location: .querystring("nextToken")),
            AWSMemberEncoding(label: "site", location: .querystring("site"))
        ]

        public let maxResults: Int?
        public let nextToken: String?
        public let site: String

        public init(maxResults: Int? = nil, nextToken: String? = nil, site: String) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.site = site
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 25)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "[a-zA-Z0-9_.-/+=]*")
            try self.validate(self.site, name: "site", parent: name, max: 1011)
            try self.validate(self.site, name: "site", parent: name, min: 1)
            try self.validate(self.site, name: "site", parent: name, pattern: "^arn:aws:iotroborunner:[\\w-]+:\\w+:site/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListWorkerFleetsResponse: AWSDecodableShape {
        public let nextToken: String?
        public let workerFleets: [WorkerFleet]?

        public init(nextToken: String? = nil, workerFleets: [WorkerFleet]? = nil) {
            self.nextToken = nextToken
            self.workerFleets = workerFleets
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken
            case workerFleets
        }
    }

    public struct ListWorkersRequest: AWSEncodableShape {
        public static var _encoding = [
            AWSMemberEncoding(label: "fleet", location: .querystring("fleet")),
            AWSMemberEncoding(label: "maxResults", location: .querystring("maxResults")),
            AWSMemberEncoding(label: "nextToken", location: .querystring("nextToken")),
            AWSMemberEncoding(label: "site", location: .querystring("site"))
        ]

        public let fleet: String?
        public let maxResults: Int?
        public let nextToken: String?
        public let site: String

        public init(fleet: String? = nil, maxResults: Int? = nil, nextToken: String? = nil, site: String) {
            self.fleet = fleet
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.site = site
        }

        public func validate(name: String) throws {
            try self.validate(self.fleet, name: "fleet", parent: name, max: 1011)
            try self.validate(self.fleet, name: "fleet", parent: name, min: 1)
            try self.validate(self.fleet, name: "fleet", parent: name, pattern: "^arn:aws:iotroborunner:[\\w-]+:\\w+:site/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/worker-fleet/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 25)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "[a-zA-Z0-9_.-/+=]*")
            try self.validate(self.site, name: "site", parent: name, max: 1011)
            try self.validate(self.site, name: "site", parent: name, min: 1)
            try self.validate(self.site, name: "site", parent: name, pattern: "^arn:aws:iotroborunner:[\\w-]+:\\w+:site/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListWorkersResponse: AWSDecodableShape {
        public let nextToken: String?
        public let workers: [Worker]?

        public init(nextToken: String? = nil, workers: [Worker]? = nil) {
            self.nextToken = nextToken
            self.workers = workers
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken
            case workers
        }
    }

    public struct Site: AWSDecodableShape {
        public let arn: String
        public let countryCode: String
        public let createdAt: Date
        /// The name of the site. Mutable after creation and unique within a given account.
        public let name: String

        public init(arn: String, countryCode: String, createdAt: Date, name: String) {
            self.arn = arn
            self.countryCode = countryCode
            self.createdAt = createdAt
            self.name = name
        }

        private enum CodingKeys: String, CodingKey {
            case arn
            case countryCode
            case createdAt
            case name
        }
    }

    public struct UpdateDestinationRequest: AWSEncodableShape {
        public let additionalFixedProperties: String?
        public let id: String
        public let name: String?
        public let state: DestinationState?

        public init(additionalFixedProperties: String? = nil, id: String, name: String? = nil, state: DestinationState? = nil) {
            self.additionalFixedProperties = additionalFixedProperties
            self.id = id
            self.name = name
            self.state = state
        }

        public func validate(name: String) throws {
            try self.validate(self.additionalFixedProperties, name: "additionalFixedProperties", parent: name, max: 131_072)
            try self.validate(self.additionalFixedProperties, name: "additionalFixedProperties", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, max: 1011)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "^arn:aws:iotroborunner:[\\w-]+:\\w+:destination/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$|^arn:aws:iotroborunner:[\\w-]+:\\w+:site/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/destination/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")
            try self.validate(self.name, name: "name", parent: name, max: 255)
            try self.validate(self.name, name: "name", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case additionalFixedProperties
            case id
            case name
            case state
        }
    }

    public struct UpdateDestinationResponse: AWSDecodableShape {
        public let additionalFixedProperties: String?
        public let arn: String
        public let id: String
        public let name: String
        public let state: DestinationState
        public let updatedAt: Date

        public init(additionalFixedProperties: String? = nil, arn: String, id: String, name: String, state: DestinationState, updatedAt: Date) {
            self.additionalFixedProperties = additionalFixedProperties
            self.arn = arn
            self.id = id
            self.name = name
            self.state = state
            self.updatedAt = updatedAt
        }

        private enum CodingKeys: String, CodingKey {
            case additionalFixedProperties
            case arn
            case id
            case name
            case state
            case updatedAt
        }
    }

    public struct UpdateSiteRequest: AWSEncodableShape {
        public let countryCode: String?
        public let description: String?
        public let id: String
        public let name: String?

        public init(countryCode: String? = nil, description: String? = nil, id: String, name: String? = nil) {
            self.countryCode = countryCode
            self.description = description
            self.id = id
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.countryCode, name: "countryCode", parent: name, max: 2)
            try self.validate(self.countryCode, name: "countryCode", parent: name, min: 2)
            try self.validate(self.countryCode, name: "countryCode", parent: name, pattern: "^[a-zA-Z]{2}$")
            try self.validate(self.description, name: "description", parent: name, max: 140)
            try self.validate(self.id, name: "id", parent: name, max: 1011)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "^arn:aws:iotroborunner:[\\w-]+:\\w+:site/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")
            try self.validate(self.name, name: "name", parent: name, max: 255)
            try self.validate(self.name, name: "name", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case countryCode
            case description
            case id
            case name
        }
    }

    public struct UpdateSiteResponse: AWSDecodableShape {
        public let arn: String
        public let countryCode: String?
        public let description: String?
        public let id: String
        public let name: String
        public let updatedAt: Date

        public init(arn: String, countryCode: String? = nil, description: String? = nil, id: String, name: String, updatedAt: Date) {
            self.arn = arn
            self.countryCode = countryCode
            self.description = description
            self.id = id
            self.name = name
            self.updatedAt = updatedAt
        }

        private enum CodingKeys: String, CodingKey {
            case arn
            case countryCode
            case description
            case id
            case name
            case updatedAt
        }
    }

    public struct UpdateWorkerFleetRequest: AWSEncodableShape {
        public let additionalFixedProperties: String?
        public let id: String
        public let name: String?

        public init(additionalFixedProperties: String? = nil, id: String, name: String? = nil) {
            self.additionalFixedProperties = additionalFixedProperties
            self.id = id
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.additionalFixedProperties, name: "additionalFixedProperties", parent: name, max: 131_072)
            try self.validate(self.additionalFixedProperties, name: "additionalFixedProperties", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, max: 1011)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "^arn:aws:iotroborunner:[\\w-]+:\\w+:site/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/worker-fleet/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")
            try self.validate(self.name, name: "name", parent: name, max: 255)
            try self.validate(self.name, name: "name", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case additionalFixedProperties
            case id
            case name
        }
    }

    public struct UpdateWorkerFleetResponse: AWSDecodableShape {
        public let additionalFixedProperties: String?
        public let arn: String
        public let id: String
        public let name: String
        public let updatedAt: Date

        public init(additionalFixedProperties: String? = nil, arn: String, id: String, name: String, updatedAt: Date) {
            self.additionalFixedProperties = additionalFixedProperties
            self.arn = arn
            self.id = id
            self.name = name
            self.updatedAt = updatedAt
        }

        private enum CodingKeys: String, CodingKey {
            case additionalFixedProperties
            case arn
            case id
            case name
            case updatedAt
        }
    }

    public struct UpdateWorkerRequest: AWSEncodableShape {
        public let additionalFixedProperties: String?
        public let additionalTransientProperties: String?
        public let id: String
        public let name: String?
        public let orientation: Orientation?
        public let position: PositionCoordinates?
        public let vendorProperties: VendorProperties?

        public init(additionalFixedProperties: String? = nil, additionalTransientProperties: String? = nil, id: String, name: String? = nil, orientation: Orientation? = nil, position: PositionCoordinates? = nil, vendorProperties: VendorProperties? = nil) {
            self.additionalFixedProperties = additionalFixedProperties
            self.additionalTransientProperties = additionalTransientProperties
            self.id = id
            self.name = name
            self.orientation = orientation
            self.position = position
            self.vendorProperties = vendorProperties
        }

        public func validate(name: String) throws {
            try self.validate(self.additionalFixedProperties, name: "additionalFixedProperties", parent: name, max: 131_072)
            try self.validate(self.additionalFixedProperties, name: "additionalFixedProperties", parent: name, min: 1)
            try self.validate(self.additionalTransientProperties, name: "additionalTransientProperties", parent: name, max: 131_072)
            try self.validate(self.additionalTransientProperties, name: "additionalTransientProperties", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, max: 1011)
            try self.validate(self.id, name: "id", parent: name, min: 1)
            try self.validate(self.id, name: "id", parent: name, pattern: "^arn:aws:iotroborunner:[\\w-]+:\\w+:site/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/worker-fleet/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/worker/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")
            try self.validate(self.name, name: "name", parent: name, max: 255)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.vendorProperties?.validate(name: "\(name).vendorProperties")
        }

        private enum CodingKeys: String, CodingKey {
            case additionalFixedProperties
            case additionalTransientProperties
            case id
            case name
            case orientation
            case position
            case vendorProperties
        }
    }

    public struct UpdateWorkerResponse: AWSDecodableShape {
        public let additionalFixedProperties: String?
        public let additionalTransientProperties: String?
        public let arn: String
        public let fleet: String
        public let id: String
        public let name: String
        public let orientation: Orientation?
        public let position: PositionCoordinates?
        public let updatedAt: Date
        public let vendorProperties: VendorProperties?

        public init(additionalFixedProperties: String? = nil, additionalTransientProperties: String? = nil, arn: String, fleet: String, id: String, name: String, orientation: Orientation? = nil, position: PositionCoordinates? = nil, updatedAt: Date, vendorProperties: VendorProperties? = nil) {
            self.additionalFixedProperties = additionalFixedProperties
            self.additionalTransientProperties = additionalTransientProperties
            self.arn = arn
            self.fleet = fleet
            self.id = id
            self.name = name
            self.orientation = orientation
            self.position = position
            self.updatedAt = updatedAt
            self.vendorProperties = vendorProperties
        }

        private enum CodingKeys: String, CodingKey {
            case additionalFixedProperties
            case additionalTransientProperties
            case arn
            case fleet
            case id
            case name
            case orientation
            case position
            case updatedAt
            case vendorProperties
        }
    }

    public struct VendorProperties: AWSEncodableShape & AWSDecodableShape {
        public let vendorAdditionalFixedProperties: String?
        public let vendorAdditionalTransientProperties: String?
        public let vendorWorkerId: String
        public let vendorWorkerIpAddress: String?

        public init(vendorAdditionalFixedProperties: String? = nil, vendorAdditionalTransientProperties: String? = nil, vendorWorkerId: String, vendorWorkerIpAddress: String? = nil) {
            self.vendorAdditionalFixedProperties = vendorAdditionalFixedProperties
            self.vendorAdditionalTransientProperties = vendorAdditionalTransientProperties
            self.vendorWorkerId = vendorWorkerId
            self.vendorWorkerIpAddress = vendorWorkerIpAddress
        }

        public func validate(name: String) throws {
            try self.validate(self.vendorAdditionalFixedProperties, name: "vendorAdditionalFixedProperties", parent: name, max: 131_072)
            try self.validate(self.vendorAdditionalFixedProperties, name: "vendorAdditionalFixedProperties", parent: name, min: 1)
            try self.validate(self.vendorAdditionalTransientProperties, name: "vendorAdditionalTransientProperties", parent: name, max: 131_072)
            try self.validate(self.vendorAdditionalTransientProperties, name: "vendorAdditionalTransientProperties", parent: name, min: 1)
            try self.validate(self.vendorWorkerId, name: "vendorWorkerId", parent: name, max: 255)
            try self.validate(self.vendorWorkerId, name: "vendorWorkerId", parent: name, min: 1)
            try self.validate(self.vendorWorkerIpAddress, name: "vendorWorkerIpAddress", parent: name, max: 45)
            try self.validate(self.vendorWorkerIpAddress, name: "vendorWorkerIpAddress", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case vendorAdditionalFixedProperties
            case vendorAdditionalTransientProperties
            case vendorWorkerId
            case vendorWorkerIpAddress
        }
    }

    public struct Worker: AWSDecodableShape {
        public let additionalFixedProperties: String?
        public let additionalTransientProperties: String?
        public let arn: String
        public let createdAt: Date
        public let fleet: String
        public let id: String
        public let name: String
        public let orientation: Orientation?
        public let position: PositionCoordinates?
        public let site: String
        public let updatedAt: Date
        public let vendorProperties: VendorProperties?

        public init(additionalFixedProperties: String? = nil, additionalTransientProperties: String? = nil, arn: String, createdAt: Date, fleet: String, id: String, name: String, orientation: Orientation? = nil, position: PositionCoordinates? = nil, site: String, updatedAt: Date, vendorProperties: VendorProperties? = nil) {
            self.additionalFixedProperties = additionalFixedProperties
            self.additionalTransientProperties = additionalTransientProperties
            self.arn = arn
            self.createdAt = createdAt
            self.fleet = fleet
            self.id = id
            self.name = name
            self.orientation = orientation
            self.position = position
            self.site = site
            self.updatedAt = updatedAt
            self.vendorProperties = vendorProperties
        }

        private enum CodingKeys: String, CodingKey {
            case additionalFixedProperties
            case additionalTransientProperties
            case arn
            case createdAt
            case fleet
            case id
            case name
            case orientation
            case position
            case site
            case updatedAt
            case vendorProperties
        }
    }

    public struct WorkerFleet: AWSDecodableShape {
        public let additionalFixedProperties: String?
        public let arn: String
        public let createdAt: Date
        public let id: String
        public let name: String
        public let site: String
        public let updatedAt: Date

        public init(additionalFixedProperties: String? = nil, arn: String, createdAt: Date, id: String, name: String, site: String, updatedAt: Date) {
            self.additionalFixedProperties = additionalFixedProperties
            self.arn = arn
            self.createdAt = createdAt
            self.id = id
            self.name = name
            self.site = site
            self.updatedAt = updatedAt
        }

        private enum CodingKeys: String, CodingKey {
            case additionalFixedProperties
            case arn
            case createdAt
            case id
            case name
            case site
            case updatedAt
        }
    }

    public struct Orientation: AWSEncodableShape & AWSDecodableShape {
        /// Degrees, limited on [0, 360)
        public let degrees: Double?

        public init(degrees: Double? = nil) {
            self.degrees = degrees
        }

        private enum CodingKeys: String, CodingKey {
            case degrees
        }
    }

    public struct PositionCoordinates: AWSEncodableShape & AWSDecodableShape {
        /// Cartesian coordinates.
        public let cartesianCoordinates: CartesianCoordinates?

        public init(cartesianCoordinates: CartesianCoordinates? = nil) {
            self.cartesianCoordinates = cartesianCoordinates
        }

        private enum CodingKeys: String, CodingKey {
            case cartesianCoordinates
        }
    }
}

// MARK: - Errors

/// Error enum for IoTRoboRunner
public struct IoTRoboRunnerErrorType: AWSErrorType {
    enum Code: String {
        case accessDeniedException = "AccessDeniedException"
        case conflictException = "ConflictException"
        case internalServerException = "InternalServerException"
        case resourceNotFoundException = "ResourceNotFoundException"
        case serviceQuotaExceededException = "ServiceQuotaExceededException"
        case throttlingException = "ThrottlingException"
        case validationException = "ValidationException"
    }

    private let error: Code
    public let context: AWSErrorContext?

    /// initialize IoTRoboRunner
    public init?(errorCode: String, context: AWSErrorContext) {
        guard let error = Code(rawValue: errorCode) else { return nil }
        self.error = error
        self.context = context
    }

    internal init(_ error: Code) {
        self.error = error
        self.context = nil
    }

    /// return error code string
    public var errorCode: String { self.error.rawValue }

    ///  User does not have sufficient access to perform this action.
    public static var accessDeniedException: Self { .init(.accessDeniedException) }
    /// Exception thrown if a resource in a create request already exists.
    public static var conflictException: Self { .init(.conflictException) }
    /// Exception thrown if something goes wrong within the service.
    public static var internalServerException: Self { .init(.internalServerException) }
    /// Exception thrown if a resource referenced in the request doesn&#39;t exist.
    public static var resourceNotFoundException: Self { .init(.resourceNotFoundException) }
    /// Exception thrown if the user&#39;s AWS account has reached a service limit and the operation cannot proceed.
    public static var serviceQuotaExceededException: Self { .init(.serviceQuotaExceededException) }
    /// Exception thrown if the api has been called too quickly be the client.
    public static var throttlingException: Self { .init(.throttlingException) }
    /// Exception thrown if an invalid parameter is provided to an API.
    public static var validationException: Self { .init(.validationException) }
}

extension IoTRoboRunnerErrorType: Equatable {
    public static func == (lhs: IoTRoboRunnerErrorType, rhs: IoTRoboRunnerErrorType) -> Bool {
        lhs.error == rhs.error
    }
}

extension IoTRoboRunnerErrorType: CustomStringConvertible {
    public var description: String {
        return "\(self.error.rawValue): \(self.message ?? "")"
    }
}
